Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Getting Travis CI to work with Chromium testing - #2731

Merged
semenko merged 7 commits into
EFForg:masterfrom
TheNavigat:new-test-structure
Sep 5, 2015
Merged

semenko merged 7 commits into
EFForg:masterfrom
TheNavigat:new-test-structure

Conversation

@TheNavigat

Copy link
Copy Markdown
Contributor

This PR is not complete. test.sh does not start Chromium testing because of a bug I'm still trying to figure out how to fix. However, it's fine for me if someone would like to merge it and let me create another PR to fix this issue. Otherwise, I'm still figuring out how to make Chromium testing run properly through test.sh.

@TheNavigat

Copy link
Copy Markdown
Contributor Author

Okay, the PR's ready @semenko

@TheNavigat

Copy link
Copy Markdown
Contributor Author

On a side note, I'm delighted as fuck that we finally got this working. Just thought that this comment deserves to exist here.

@semenko

semenko commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

Whoa -- awesome!

Looks like Travis isn't quite as happy as it claims. Click the little green arrow by the commit for the full log:
https://travis-ci.org/EFForg/https-everywhere/builds/78120167

+./test/chromium.sh
++dirname ./test/chromium.sh
+++readlink ./test/chromium.sh
++dirname
dirname: missing operand
Try `dirname --help' for more information.
+cd ./test/../
+'[' '' == --justrun ']'
+./makecrx.sh

and early on

Disallowing packages: chromium-chromedriver
  1. Looks like chromedriver for Travis might be tricky. There's probably info in this issue (I haven't read it yet): Chromedriver support? travis-ci/travis-ci#272
  2. We'll want to make sure that the ./test.sh script hard fails on these errors (so Travis can't erroneously report success). Not sure what's up here -- maybe we haven't set pipefail somewhere (e.g. set -o pipefail)

@TheNavigat

Copy link
Copy Markdown
Contributor Author

I mistakenly returned a 0 exit code in test/script.py when ChromeDriver's missing.

Regarding Travis, whoa... "Disallowing"?!

I checked the ticket again, read it line by line, and now I get why it isn't (and will never) work. It's because of Xvfb, Travis doesn't support it. I used a trick before to run Chrome and Chromedriver headlessly, by using pyvirtualdisplay, but as I checked right now, that relies on Xvfb as well, which is (again) not supported by Travis.

So yea... What to do now?

@semenko

semenko commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

Perhaps something like: travis-ci/travis-ci#938 (comment) ? Not 100% clear that's successful for the commenter.

You can either remove Chrome from Travis here (and I'll merge this after a more careful review) and try a separate PR for Chrome + Travis (or Sauce Labs, I guess...), or try the above here.

@TheNavigat

Copy link
Copy Markdown
Contributor Author

This looks good, https://github.com/andy11/ScriptObservatory/blob/4587f5400dd95edc4fbac7a7a0a59c81532e3bf9/.travis.yml . I'll try it out in an hour or two. If it failed I'll remove/comment Chrome's testing in test.sh and then we can merge this PR and start another one to slowly get the whole thing fixed step by step.

Oh and Xvfb does work. Sorry, that was a mistake.

I might try the pyvirtualdisplay trick. It might work, who knows.

@TheNavigat

Copy link
Copy Markdown
Contributor Author

How can I test Travis locally?

@TheNavigat
TheNavigat force-pushed the new-test-structure branch 3 times, most recently from 3f8d7a5 to 3918baa Compare September 1, 2015 14:20
@TheNavigat
TheNavigat force-pushed the new-test-structure branch 13 times, most recently from 595face to 057114b Compare September 1, 2015 16:07
@TheNavigat

Copy link
Copy Markdown
Contributor Author

https://travis-ci.org/EFForg/https-everywhere/builds/78631398

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally

:(

@TheNavigat TheNavigat changed the title Restructuring test directories Getting Travis CI to work with Chromium testing Sep 3, 2015
@semenko

semenko commented Sep 3, 2015

Copy link
Copy Markdown
Contributor

Heh, this has gone pretty deep down the rabbit hole. I'm guessing this breaks because a deprecated setuid/setgid requirement for Chromium (that we can ultimately fix with --disable-setuid-sandbox).

Switch sudo: false to sudo: true, and I'll do some offline tests then hopefully merge :)

@TheNavigat
TheNavigat force-pushed the new-test-structure branch 2 times, most recently from 638a258 to f536d7d Compare September 3, 2015 19:10
@TheNavigat

Copy link
Copy Markdown
Contributor Author

I tried using --disable-setuid-sandbox, https://travis-ci.org/EFForg/https-everywhere/builds/78634510. Didn't work.

I'll switch it to required (I think we need required, not true) and push.

@TheNavigat
TheNavigat force-pushed the new-test-structure branch 3 times, most recently from 4bfb2df to 066267b Compare September 3, 2015 19:27
@TheNavigat

Copy link
Copy Markdown
Contributor Author

There's something weird happening. The path part is what makes Chrome fail.

See here, https://travis-ci.org/EFForg/https-everywhere/builds/78636591
And here, https://travis-ci.org/EFForg/https-everywhere/builds/78637370

@TheNavigat
TheNavigat force-pushed the new-test-structure branch 8 times, most recently from a9007db to 27158b9 Compare September 3, 2015 20:32
@TheNavigat

Copy link
Copy Markdown
Contributor Author

So, the PATH command won't work, and moving chromedriver to test/chromium/chromedriver won't work either. https://travis-ci.org/EFForg/https-everywhere/builds/78647768

Selenium expects ChromeDriver to be in a PATH location, and does not try to locate chromedriver in its own directory. I can explicitly force it to do, though. I'll try that right now.

@TheNavigat
TheNavigat force-pushed the new-test-structure branch 3 times, most recently from e43f94e to 540c60a Compare September 3, 2015 20:42
@TheNavigat

Copy link
Copy Markdown
Contributor Author

The non-sudo script is ready. This deserves a party.

@semenko

semenko commented Sep 4, 2015

Copy link
Copy Markdown
Contributor

Awesome! Thanks so much for your hard work!

I'll do some offline testing, and hopefully merge this tonight! 👍

@semenko

semenko commented Sep 5, 2015

Copy link
Copy Markdown
Contributor

Cool -- a couple nits that I'll fix post merge. Thanks again!

semenko added a commit that referenced this pull request Sep 5, 2015
Getting Travis CI to work with Chromium testing
@semenko
semenko merged commit ecdff2b into EFForg:master Sep 5, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants